virtual_map

hidden type virtual_map<K: -immutable, V0, V> : iterable<(K, V)>

Since

0.9.0

Functions

Link copied to clipboard
pure function contains(key: K): boolean

Checks if the map contains a key.

Link copied to clipboard
pure function empty(): boolean

Checks if the map is empty.

Link copied to clipboard
pure function get(key: K): V

Gets the value associated with a key in the map. Fails if the key is not found.

Link copied to clipboard
pure function <R: +V> get_or_default(key: K, default: R): R

Gets the value associated with a key in the map, or a default value if the key is not found.

Link copied to clipboard
pure function get_or_null(key: K): V?

Gets the value associated with a key in the map, returning null if the key is not found.

Link copied to clipboard
pure function join_to_text([separator: text], [prefix: text], [postfix: text], [limit: integer?], [truncated: text], [transform: ((K, V)) -> text]): text

Creates a text from all the elements separated using separator and using the given prefix and postfix if supplied.

If the iterable is large, you can specify a non-negative value of limit, in which case only the first limit of elements will be appended, followed by the truncated text (which defaults to "...").

Link copied to clipboard
pure function keys(): set<K>
Link copied to clipboard
(alias) pure function len(): integer

Gets the size of the map.

Alias
Link copied to clipboard
pure function size(): integer

Gets the size of the map.

Link copied to clipboard
(alias) pure function str(): text

Converts the map to text.

Alias
Link copied to clipboard
function to_full(): map<K, V0>
Link copied to clipboard
pure function to_text(): text

Converts the map to text.

Link copied to clipboard
pure function values(): list<V>